package com.easy.common;

public class CommonResult {
    private static final long serialVersionUID=11111L;
    private int code;
    private String message;
    private Object data;


    public CommonResult(){}
    public CommonResult(int code,String message, Object data) {
        this.code = code;
        this.message = message;
        this.data = data;

    }
    public static CommonResult success(){

        return new CommonResult(200,"成功",null);
    }
    public static CommonResult success(int code,String message){

        return new CommonResult( code,message,null);
    }


    public static CommonResult success(int code,String message,Object data){

        return new CommonResult(code,message,data);
    }

    public static CommonResult success(Object data){

        return new CommonResult(200,"success",data);
    }
    public static CommonResult failed(int code,String message){

        return new CommonResult(code,message,null);
    }

    public static CommonResult failed(int code,String message,Object data){

        return new CommonResult(code,message,data);
    }

    public static CommonResult failed(){

        return new CommonResult(200,"失败",null);
    }


    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }
}
